import request from '@/utils/request'

//修改主分类
export function editMainClass(data) {
  return request({
    url: "/project/projectInfo/editMainClass",
    method: "post",
    data
  });
}
//修改项目状态
export function editState(data) {
  return request({
    url: "/project/projectInfo/editState",
    method: "post",
    data
  });
}
//主项目变更
export function editProjectInfoChange(data) {
  return request({
    url: "/project/projectInfo/editProjectInfoChange",
    method: "post",
    data
  });
}
//子项目变更
export function editSubProjectInfoChange(data) {
  return request({
    url: "/project/projectInfo/editSubProjectInfoChange",
    method: "post",
    data
  });
}
// 查询项目信息主子列表
export function listProjectTree(query) {
  return request({
    url: '/project/projectInfo/listProjectTree',
    method: 'get',
    params: query
  })
}
// 查询项目信息主子列表
export function listOver(query) {
  return request({
    url: '/project/projectInfo/listOver',
    method: 'get',
    params: query
  })
}

// 查询项目信息主子列表
export function otherProjectList(query) {
  return request({
    url: '/project/projectInfo/otherList',
    method: 'get',
    params: query
  })
}


//查询所有项目信息
export function listProjectInfoAll(query) {
  return request({
    url: '/project/projectInfo/listProjectAll',
    method: 'get',
    params: query
  })
}
// 查询项目信息列表
export function listProjectInfo(query) {
  return request({
    url: '/project/projectInfo/list',
    method: 'get',
    params: query
  })
}

export function listSubProjectInfo(query) {
  return request({
    url: '/project/projectInfo/listSub',
    method: 'get',
    params: query
  })
}

export function listSubProjectTree(query) {
  return request({
    url: '/project/projectInfo/listSubProjectTree',
    method: 'get',
    params: query
  })
}

// 查询项目信息详细
export function getProjectInfo(projectId) {
  return request({
    url: '/project/projectInfo/' + projectId,
    method: 'get'
  })
}

// 新增项目信息
export function addProjectInfo(data) {
  return request({
    url: '/project/projectInfo',
    method: 'post',
    data: data
  })
}

// 修改项目信息
export function updateProjectInfo(data) {
  return request({
    url: '/project/projectInfo',
    method: 'put',
    data: data
  })
}

// 修改子项目状态
export function editSubState(data) {
  return request({
    url: '/project/projectInfo/editSubState',
    method: 'post',
    data: data
  })
}
// 删除项目信息
export function delProjectInfo(projectId) {
  return request({
    url: '/project/projectInfo/' + projectId,
    method: 'delete'
  })
}

// 查询项目信息和客户信息
export function selectProjectContract(projectId) {
  return request({
    url: '/project/projectInfo/selectProjectContract/' + projectId,
    method: 'get'
  })
}

//查询交付项目
export function listDeliverProject(query) {
  return request({
      url:'project/projectInfo/workList',
      method:'get',
      params:query
  })
}

//删除子项目
export function delSubProject(id) {
  return request({
    url:'/project/subProjectInfo/'+id,
    method:'delete'
    })
}
